#include "Entity.h"

Entity::Entity()
{
	Position = Vector3(0.0f, 0.0f, 0.0f);

	Scale = Vector3(1.0f, 1.0f, 1.0f);
	Rotate = Vector3(0.0f, 0.0f, 0.0f);
	Translate = Vector3(0.0f, 0.0f, 0.0f);

	m_LocalWorld.SetIdentity();
}

Entity::~Entity()
{
	
}

void Entity::SetRotateX(FWfloat x)
{
	Rotate.x += x;
}

void Entity::SetRotateY(FWfloat y)
{
	Rotate.y += y;
}

void Entity::SetRatatez(FWfloat z)
{
	Rotate.z += z;
}

void Entity::Update(FWfloat deltaTime)
{
	Matrix scale = Matrix().SetIdentity();
	Matrix rot = Matrix().SetIdentity();
	Matrix trans = Matrix().SetIdentity();

	scale.SetScale(Scale);
	Matrix rotX = Matrix().SetIdentity().SetRotationX(Rotate.x);
	Matrix rotY = Matrix().SetIdentity().SetRotationY(Rotate.y);
	Matrix rotZ = Matrix().SetIdentity().SetRotationZ(Rotate.z);
	rot = rotZ*rotX*rotY;

	trans.SetTranslation(Translate);

	m_LocalWorld = scale * rot * trans;
}